/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: zhnb
 * Date: 2011-8-1 下午02:44:00
 */
package com.number.app;

import java.io.Serializable;

public class MyApplicationClient extends Ice.Application implements Serializable {

    private static final long serialVersionUID = 3403623570377085228L;

    @Override
    public int run(String[] args) {

        if (args.length > 0) {
            System.out.println(appName() + ": too many arguments");
            return 1;
        }
        
        //
        Ice.Properties properties = communicator().getProperties();
        
        StringBuffer buff = new StringBuffer();
//        // the following two line be used to set value for the Catagory.
//        buff.append(properties.getProperty("MyApplicationServer.name"));
//        buff.append("/");
        buff.append(properties.getProperty("MyApp.com.number.app.MyApplicationI.uuId"));
        buff.append(":");
        buff.append(properties.getProperty("MyApplicationServer.Endpoints"));
        
        MyApplicationPrx myApplicationPrx = null;
        
        System.out.println(buff.toString());
        
        myApplicationPrx = MyApplicationPrxHelper.checkedCast(communicator().stringToProxy(buff.toString()));
        String str = myApplicationPrx.getAppInfo();
        
        System.out.println(str);
        
        return 0;
    }
    
    public static void main(String[] args) {
        MyApplicationClient myApplicationClient = new MyApplicationClient();
        int statues = myApplicationClient.main("MyApplicationClient", args, "com/number/app/myApp-client.config");
        System.exit(statues);
    }

}
